﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using foursquare.Foursquare;

namespace foursquare.Forms
{
    public partial class VenueView : Form
    {
        public VenueView(string vid)
        {
            InitializeComponent();

            if (!String.IsNullOrEmpty(vid))
            {
                Venue v = FS.GetVenue(Convert.ToInt32(vid));

                pnlMain.Width = this.ClientRectangle.Width;
                pnlMain.Height = this.ClientRectangle.Height;
           
                pnlMain.Controls.Add(LabelControl(v.name));
                pnlMain.Controls.Add(LabelControl(v.address));
                pnlMain.Controls.Add(LabelControl(v.city + " " + v.state));

                
            }
        }

        private Label LabelControl(string text)
        {
            Rectangle rect = this.ClientRectangle;

            Label lbl = new Label();
            lbl.Text = text;
            lbl.Width = this.ClientRectangle.Width;
            lbl.Height = (int)CFMeasureString.MeasureString(lbl, lbl.Text, rect).Height;
            lbl.Dock = DockStyle.Bottom;
            return lbl;
        }
    }
}